use "$path\datasets\rd_dataset.dta", clear


preserve
bysort gkz jahr: keep if _n==1
sort gkz jahr
xtset gkz  jahr
gen d_density=d.density
gen lag_total_child_places_pc=l.total_child_places_pc
keep gkz jahr d_density lag_total_child_places_pc
tempfile temp
save `temp', replace
restore

merge m:1 gkz jahr using `temp'


local depvar "lag_total_child_places_pc"
rdd_plot  `depvar',  includedbw(0.15)  control(margin_1) binsize(0.01)  bw(0.10) title("Child care spots pc in t-1") xtitle("Female candidate margin of victory (%)")
graph export FigureA15/figureA15a.pdf, replace



local depvar "d_density"
rdd_plot  `depvar',  includedbw(0.15)  control(margin_1) binsize(0.01)  bw(0.10) title("$\Delta$ Density") xtitle("Female candidate margin of victory (%)")
graph export FigureA15/figureA15b.pdf, replace


local depvar "unter_14jahre_sh"
rdd_plot  `depvar',  includedbw(0.15)  control(margin_1) binsize(0.01)  bw(0.10) title("Share of population below 14 years") xtitle("Female candidate margin of victory (%)")
graph export FigureA15/figureA15c.pdf, replace
